Conversation
omerlh
left a comment
There was a problem hiding this comment.
Also, please add some testing
| require 'glue/mounters/base_mounter' | ||
| require 'fileutils' | ||
|
|
||
| class Glue::AzDOMounter < Glue::BaseMounter |
There was a problem hiding this comment.
Maybe think on a more clear name? AzureGitMounter maybe?
| super(trigger) | ||
| @options = options | ||
| @name = "AzDO Git" | ||
| @description = "Pull a repo." |
There was a problem hiding this comment.
| @description = "Pull a repo." | |
| @description = "Pull a repository from Azure DevOps" |
| def mount target | ||
| base = @options[:working_dir] | ||
|
|
||
| Glue.debug "Making base." |
|
|
||
| # Grab the path used as git url, excluding PAT. | ||
| # format of this target must be https://DUMMY:<PAT_TOKEN>@dev.azure.com/<account>/<project>/_git/<repository> | ||
| protocol, azdo_domain, account, project, repository = target.match(/\A(.*\/\/).*@(.*)\/(.*)\/(.*)\/_git\/(.+?)[\/]{0,1}\z/i).captures |
There was a problem hiding this comment.
Maybe get these parameters separately and build the URL?
There was a problem hiding this comment.
I am thinking on maybe having PATTOKEN as a configuration parameter, as can be useful for something else (working on creating work items on Azure DevOps, like the ones for Jira, Pivotal...)
Parameters I extract from the match are for building the folder name used for temporary storage, but the target url should be ````https://dev.azure.com/../../_git/....```
So that way, you can just use the Git Url you can copy/paste from Azure DevOps
There was a problem hiding this comment.
Ohh I see. Ok, so just move the PAT to paramter - which could also help in reducting it.
Where can I find tests for the other mounters? |
|
The test coverage is not amazing - look on different tests under the |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
GitMounter lacks the ability of mounting git repositories from Azure DevOps
I decided to create a new mounter, heavily inspired by the git one, to be able to mount Azure DevOps (aka Visual Studio Team Services) git repositories when they are specified as a target
format of the target URL should be:
It requires a Personal Access Token to be used as part of the target url, and having, at least, Code/Read capabilities against such repository, as specified in this link
sample of the tool mounting an Azure Devops repository and starting scanning the content:
Concern is having PAT tokens leaking on logs, so might be useful to redact that from the base mounters files.
Also, thinking on allowing PAT token to be a configuration option and use it for this mounter instead of using targets including tokens as part of the string